Releases version 11.1.0 #25
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
AndroidX Activity 1.9+ introduced a breaking change in the
onNewIntent()method signature for Kotlin projects. The Android API changed to make theIntentparameter non-nullable (Intentinstead ofIntent?), which conflicts with the code automatically generated by our Expo plugin.Before (AndroidX Activity < 1.9):
After (AndroidX Activity 1.9+):
Without this fix, developers using AndroidX Activity 1.9+ encounter Kotlin compilation errors when the plugin generates code with the old nullable signature.
Solution
Added the optional
shouldUseNonNullableIntentparameter to the Expo plugin config, allowing developers to specify theIntentparameter nullability based on their AndroidX Activity version.Usage Examples
For AndroidX Activity 1.9+:
{ "plugins": [ [ "@batch.com/react-native-plugin", { "androidApiKey": "YOUR_ANDROID_API_KEY", "iosApiKey": "YOUR_IOS_API_KEY", "shouldUseNonNullableIntent": true } ] ] }For AndroidX Activity < 1.9 - default behavior:
{ "plugins": [ [ "@batch.com/react-native-plugin", { "androidApiKey": "YOUR_ANDROID_API_KEY", "iosApiKey": "YOUR_IOS_API_KEY" } ] ] }